#!/bin/bash
if [ $# -ne 1 -a $# -ne 2 ];
then
 echo "usage: submit.sh <scriptname> <number of runs>"
 exit -1
fi

log=/home/vbild/logs

if [ $# -eq 2 ]
  then
  if [ $2 -eq 1 ]
  then
    qsub -l nodes=cpu -j oe -o $log submit/$1.sh
  else
    submit/CreateScript.sh $1 $2
    for ((i=1;i<=$2;i++))
    do
      qsub -l nodes=cpu -j oe -o $log submit/$1_$i.sh
    done
  fi
else
  qsub -l nodes=cpu -j oe -o $log submit/$1.sh
fi

